// export const addCount = (n) => ({ type: 'add', payload: n })
// export const addCount = (dispatch) => (n) => {
//   setTimeout(() => {
//     dispatch({ type: 'add', payload: n })
//   }, 1000)
// }

// redux-thunk中间件在action中有异步操作
export const addCount = (n) => (dispatch, getState) => {
  setTimeout(() => {
    dispatch({ type: 'add', payload: n })
  }, 1000)
}
// export const addCount = (n) => ({ type: 'add', payload: n })